#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
    vector<int> numberOfPairs(vector<int>& nums) {
        int n=nums.size(),cnt=0,cnt1=0;
        if(n==1)return{0,1};
        sort(nums.begin(),nums.end());
        for(int i=0,j=1;i<n-1;)
        {   
            j=i+1;
            if(nums[i]==nums[j])
            {
                cnt++;
                i=j;
            }
            else
                cnt1++;
            if(i==n-2)cnt1++;//
            i++;
        }
        return {cnt,cnt1};
    }
};
int main()
{
    Solution s1;
    vector<int>nums({0,0,1});
    s1.numberOfPairs(nums);
}
